/* Time Trial Panel Styles */
.time-trial-panel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  color: #fff;
  font-family: 'Arial', sans-serif;
  padding: 10px;
  transition: all 0.3s ease;
}

.time-trial-panel h2 {
  margin: 0 0 15px 0;
  text-align: center;
  font-size: 1.5rem;
}

.time-trial-panel p {
  margin: 5px 0;
}

/* Track selection section */
.track-selection {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.track-list {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}

.track-item {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.track-item:hover {
  background-color: rgba(0, 0, 0, 0.5);
}

.track-item.selected {
  background-color: rgba(0, 150, 255, 0.5);
  border: 1px solid rgba(0, 150, 255, 0.8);
}

.track-info {
  flex: 1;
  min-width: 0; /* Prevent flex item from overflowing */
}

.track-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.track-header h3 {
  margin: 0;
  font-size: 1.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-difficulty {
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: capitalize;
}

.difficulty-easy {
  background-color: #44cc4433;
  color: #44cc44;
}

.difficulty-medium {
  background-color: #cccc4433;
  color: #cccc44;
}

.difficulty-hard {
  background-color: #cc444433;
  color: #cc4444;
}

.track-record {
  font-size: 0.9rem;
  color: #aaaaaa;
}

.track-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.track-description {
  font-size: 0.9rem;
  opacity: 0.8;
}

.track-best-time {
  font-size: 0.9rem;
  margin-top: 5px;
  font-weight: bold;
}

/* Controls section */
.time-trial-controls {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}

.start-race-button,
.quit-race-button {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

.start-race-button {
  background-color: #44cc44;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  min-width: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.start-race-button:hover {
  background-color: #38b638;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.start-race-button:disabled {
  background-color: #666;
  cursor: not-allowed;
}

.quit-race-button {
  background-color: #cc4444;
  color: white;
}

.quit-race-button:hover {
  background-color: #b63838;
}

/* Race HUD elements */
.race-hud {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 200px;
  pointer-events: none;
  z-index: 100;
  font-size: 14px;
}

.race-timer {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 2px;
  color: #fff;
}

.race-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  opacity: 0.9;
}

.race-checkpoints {
  color: #fff;
}

.personal-best {
  font-size: 0.9rem;
  opacity: 0.9;
}

.race-guidance {
  font-size: 0.9rem;
  margin-top: 6px;
  color: #ffff00;
  text-align: center;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.race-completed {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.85);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  min-width: 300px;
  z-index: 1000;
}

.race-completed h3 {
  margin-top: 0;
  font-size: 1.8rem;
}

.race-time {
  font-size: 2.5rem;
  margin: 15px 0;
  color: #44cc44;
}

.race-completed-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.race-completed button {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  font-weight: bold;
  cursor: pointer;
}

.restart-button {
  background-color: #4488cc;
  color: white;
}

.exit-button {
  background-color: #666;
  color: white;
}

/* Loading spinner */
.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin: 20px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Countdown overlay */
.countdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  pointer-events: none;
}

.countdown-number {
  font-size: 5rem;
  font-weight: bold;
  color: white;
  animation: pulse 1s ease-out;
}

@keyframes pulse {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Panel collapse during race */
.time-trial-panel.race-active {
  max-height: 80px;
  overflow: hidden;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .race-hud {
    width: 80%;
    top: 80px;
    min-width: 160px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .race-timer {
    font-size: 1.2rem;
  }

  .race-info-row {
    font-size: 0.8rem;
    gap: 8px;
  }

  .race-checkpoints,
  .personal-best {
    font-size: 0.8rem;
  }

  .time-trial-panel.race-active {
    max-height: 60px;
  }

  /* Make track items more compact on mobile */
  .track-item {
    padding: 10px;
    gap: 8px;
  }

  .track-header h3 {
    font-size: 1rem;
  }

  .track-difficulty {
    font-size: 0.7rem;
    padding: 1px 6px;
  }

  .track-record {
    font-size: 0.8rem;
  }

  .start-race-button {
    padding: 6px 12px;
    font-size: 0.9rem;
    min-width: 80px;
  }
} 